<script setup lang="ts">
import { useRouter } from 'vue-router';

const router = useRouter();

// 创建按钮
const createBtn = () => {
  router.push({ 
    path: '/form/category/create',
    query: { _t: Date.now() }
  });
};

// 编辑按钮
const updateBtn = (id: string = '1') => {
  router.push({ 
    path: `/form/category/edit/${id}`
  });
};

// 查看按钮
const selectBtn = (id: string = '1') => {
  router.push({ 
    path: `/form/category/view/${id}`
  });
};
</script>

<template>
  <div class="category-container">
    <el-button type="primary" @click="createBtn">创建</el-button>
    <el-button type="success" @click="updateBtn">编辑</el-button>
    <el-button type="info" @click="selectBtn">查看</el-button>
  </div>
</template>

<style scoped>
</style>
